/*文件注释
 * ===============================================================================
 * 说明：
 * 作者：zengyy
 * 版本：v1.0
 * 创建日期：2013-05-04 10:16:32
 * 完成日期： 
 * 修改纪录：  
 * ===============================================================================
 */
using System; 
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using SRF.Common.Validation;

namespace SRF.Admin.Models
{
    ///<summay>
    /// 用户信息
    ///</summay>
    [Serializable]
    public class User
    {
        #region 属性

        /// <summary>
        /// 
        /// </summary> 
        [DisplayName("")] 
        public string Id { get; set; }
        /// <summary>
        /// 姓名
        /// </summary> 
        [Required(ErrorMessage = "请输入姓名")]
        [DisplayName("姓名")] 
        public string Name { get; set; }
        /// <summary>
        /// 登录名
        /// </summary> 
        [Required(ErrorMessage = "请输入登录名")]
        [DisplayName("登录名")]
        public string LoginId { get; set; }
        /// <summary>
        /// 密码
        /// </summary> 
        [DisplayName("密码")]
        [DataType(DataType.Password)]
        [Required(ErrorMessage = "密码不能为空")]
        public string Password { get; set; }
        /// <summary>
        /// 邮件
        /// </summary> 
        [DisplayName("邮件")] 
        [DataTypeValidator(DataTypePattern.Email)]
        public string Email { get; set; }
        /// <summary>
        /// 电话
        /// </summary> 
        [DisplayName("电话")]
        [DataTypeValidator(DataTypePattern.Phone)] 
        public string Phone { get; set; }
        /// <summary>
        /// IM
        /// </summary> 
        [DisplayName("IM")]
        //[ClientCustom("isnull",ErrorMessage="IM不正确")]
        public string IM { get; set; }
        /// <summary>
        /// 性别
        /// </summary> 
        [DisplayName("性别")]
        public Sex Sex { get; set; } 
        /// <summary>
        /// 有效
        /// </summary> 
        [DisplayName("有效")]
        public bool Enabled { get; set; }
        /// <summary>
        /// 部门id
        /// </summary> 
        [DisplayName("部门id")]
        [Required(ErrorMessage = "请选择部门")]
        public string DepartmentId { get; set; }
        /// <summary>
        /// 部门
        /// </summary> 
        [DisplayName("部门")] 
        public string Department { get; set; }

        /// <summary>
        /// 角色
        /// </summary> 
        [DisplayName("所属角色")]
        public string Roles { get; set; }

        #endregion
    }

    public enum Sex
    {
        [Description("男")]
        M = 1,
        [Description("女")]
        F = 2
    }
}
